package jm.nj.day08jia.demo02;
/*
* public String(String original)            //可以通过一个字符串 来创建字符串对象
* public String(char[] value)                   //使用字符串数组创建字符串对象
* public String(char[] value, int offset)//使用字符串数组的一部分创建字符串
* */
public class Teacher {
    public static void main(String[] args) {

        String s1 = new String("hello");
        System.out.println("s1 = "+s1);

        char[] chs = {'n','i','h','a','o'};
        String s2 = new String(chs);
        System.out.println("s2 = "+s2);

        String s3 = new String(chs,0,1);
        System.out.println("s3 = "+s3);
        String s4 = new String(chs,1,2);
        System.out.println("s4= "+s4);

        String s6 = "abc";

        System.out.println("s6 = "+s6);
    }
}
